package com.jiajia.arraylist;

/**
 * @author : zjj
 * @date : 2021/1/12 14:02
 */
public class Client {

    public static void main(String[] args) {
        test2();
    }

    /**
     * 测试普通方法
     */
    private static void test1(){

        MyArrayList myArrayList = new MyArrayList();
        myArrayList.add(22);
        myArrayList.add(33);
        myArrayList.add(-1);
        myArrayList.add(89);
//        myArrayList.remove(0);
//        myArrayList.remove(2);

        myArrayList.add(0,89);
        Asserts.test(myArrayList.get(0) == 89);
        Asserts.test(myArrayList.size() == 5);

        myArrayList.remove(2);
        myArrayList.add(myArrayList.size(),100);

        System.out.println(myArrayList);
    }

    /**
     * 测试扩容
     */
    private static void test2(){
        MyArrayList myArrayList = new MyArrayList();
        for (int i = 0; i < 30; i++) {
            myArrayList.add(i);

        }
        System.out.println(myArrayList);
    }
}
